package service;

import java.util.ArrayList;

import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;

import data.Data;

public class Test {
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		DBCollection coll = Data.data("link");
		DBCursor cursor = coll.find(new BasicDBObject("name","http://code.google.com"));
		
		while (cursor.hasNext()) {
//			DBObject dbObject = (DBObject) cursor.next();
//			ArrayList<String> string = new ArrayList<String>();
//			string = (ArrayList<String>) dbObject.get("friend");
//			for (int i = 0; i < string.size(); i++) {
//				System.out.println(string.get(i));
//			}
			System.out.println(cursor.next());
		}
	}
}
